package com.huishu.goods.fegin;

import com.huishu.commons.pojo.Result;
import com.huishu.commons.pojo.dto.UrlManageDTO;
import com.huishu.commons.pojo.model.UserDO;
import com.huishu.goods.fegin.fallback.UserFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @ClassName：UserFeignClient
 * @Author: ljj
 * @Date: 2023/4/10 16:27
 * @Description:
 */
@FeignClient(name = "user-server", path = "/user", fallbackFactory = UserFeignClientFallBack.class)
public interface UserFeignClient {

    /**
     * 获取用户信息
     * @param id
     * @return
     */
    @GetMapping("/user/getUserInfo/{id}")
    Result<UserDO> getUserInfo(@PathVariable Long id);

    /**
     * 生成产品url
     * @param urlManageDTO
     */
    @PostMapping("/url-manage/create")
    Result createUrl(@RequestBody UrlManageDTO urlManageDTO);

    /**
     * 修改产品url
     * @param urlManageDTO
     * @return
     */
    @PostMapping("/url-manage/update")
    Result updateUrl(@RequestBody UrlManageDTO urlManageDTO);

    /**
     * 删除链接地址
     * @param id
     * @return
     */
    @GetMapping("/url-manage/deleteUrl/{id}")
    Result deleteUrl(@PathVariable Long id);

}
